home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Fselect(2) Oct. 1, 1991 Fselect(2)
-
-
- N✓NA✓AM✓ME✓E
- Fselect - select file descriptors that are ready for read-
- ing or writing
-
- S✓SY✓YN✓NO✓OP✓PS✓SI✓IS✓S
- WORD Fselect(WORD timeout, LONG *rfds, LONG *wfds, ((long)0));
-
- D✓DE✓ES✓SC✓CR✓RI✓IP✓PT✓TI✓IO✓ON✓N
- _✓F_✓s_✓e_✓l_✓e_✓c_✓t checks two sets of open file descriptors and
- determines which have data ready to read, and/or which are
- ready to be written to. If none are ready yet, the process
- goes to sleep until some member of the sets are ready or
- until a specified amount of time has elapsed.
-
- _✓r_✓f_✓d_✓s points to a long word which represents a set of GEM-
- DOS file descriptors; bit _✓n of this long word is set if
- file descriptor _✓n is to be checked for input data. An
- empty set may optionally be represented by a NULL pointer
- instead of a pointer to 0. Similarly, _✓w_✓f_✓d_✓s points to a 32
- bit long word which indicates which file descriptors are
- to be checked for output status. When _✓F_✓s_✓e_✓l_✓e_✓c_✓t returns, the
- old values pointed to by _✓r_✓f_✓d_✓s and _✓w_✓f_✓d_✓s (if non-NULL) are
- overwritten by new long words indicating which file
- descriptors are actually ready for reading or writing;
- these will always form subsets of the file descriptors
- originally specified as being of interest.
-
- _✓t_✓i_✓m_✓e_✓o_✓u_✓t is a 16 bit unsigned integer specifying a maximum
- number of milliseconds to wait before returning; if this
- number is 0, no maximum is set and the call will block
- until one of the file descriptors specified is ready for
- reading or writing, as appropriate. Thus, _✓F_✓s_✓e_✓-
- _✓l_✓e_✓c_✓t(0,_✓0_✓L_✓,0L,_✓0_✓L_✓) will block forever, whereas _✓F_✓s_✓e_✓-
- _✓l_✓e_✓c_✓t(1,_✓0_✓L_✓,0L,_✓0_✓L_✓) will pause for 1 millisecond.
-
- The final argument, a long word, must always be 0 (it is
- reserved for future enhancements).
-
- R✓RE✓ET✓TU✓UR✓RN✓NS✓S
- The sum of the numbers of bits set in the long words
- pointed to by _✓r_✓f_✓d_✓s and _✓w_✓f_✓d_✓s. This will be 0 if the time-
- out expires without any of the specified file descriptors
- becoming ready for reading or writing, as appropriate, and
- nonzero otherwise.
-
- EIHNDL if any handle specified by the long words pointed
- to by _✓r_✓f_✓d_✓s or _✓w_✓f_✓d_✓s is not a valid (open) GEMDOS handle.
-
- S✓SE✓EE✓E A✓AL✓LS✓SO✓O
- _✓F_✓i_✓n_✓s_✓t_✓a_✓t(2), _✓F_✓o_✓u_✓t_✓s_✓t_✓a_✓t(2)
-
- B✓BU✓UG✓GS✓S
- The system timer is not actually accurate to the nearest
- millisecond, so the timeout could last for up to 19
-
-
-
- Version 0.9 MiNT Programmer's Manual 1
-
-
-
-
-
- Fselect(2) Oct. 1, 1991 Fselect(2)
-
-
- milliseconds longer than specified.
-
- _✓F_✓s_✓e_✓l_✓e_✓c_✓t does not work correctly on any BIOS device except
- the keyboard.
-
- Note that if an error condition occurs on one of the file
- descriptors (for example, if the read status of a pipe
- with no more writers is being requested) then _✓F_✓s_✓e_✓l_✓e_✓c_✓t will
- mark that file descriptor as being ready for reading (or
- writing, as appropriate). This is not strictly speaking a
- bug, since a subsequent read will not block (it will
- return an error condition), but programmers should be
- aware of the possibility.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Version 0.9 MiNT Programmer's Manual 2
-
-
-